package br.com.teste;

import java.awt.BorderLayout;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.SwingConstants;

public class MainClass extends JFrame {
	MainClass(String title) {
		super(title);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		JButton jb = new JButton("Ok", new ImageIcon("bullet.gif"));
		jb.setHorizontalAlignment(SwingConstants.LEFT);
		jb.setMnemonic('O');

		this.getContentPane().add(jb, BorderLayout.CENTER);

		jb = new JButton("<html><i>Cancel</i></html>");
		jb.setVerticalAlignment(SwingConstants.BOTTOM);

		jb.setDefaultCapable(true);

		this.getContentPane().add(jb, BorderLayout.EAST);

		this.getRootPane().setDefaultButton(jb);

		this.setSize(200, 100);
		this.setVisible(true);
	}

	public static void main(String[] args) {
		new MainClass("Button Demo");
	}
}